#include <stdio.h>

#define ALL_NUM 100 // 总人数
#define COUNT_NUM 3 // 报数到3的人被淘汰

int main()
{
	int people[ALL_NUM + 1]; // 存储每个人的编号，0位置无效
	int left = ALL_NUM;		 // 剩余人数
	int pos = 0;			 // 当前报数位置
	int step = 0;				 // 当前报数
	int invalid = -1;		 // 无效标记

	for (int i = 1; i <= ALL_NUM; i++)
		people[i] = i;
	people[0] = invalid;
	
	while (left > 0)
	{
		pos = (pos + 1) % (ALL_NUM + 1);
		if (people[pos] != invalid)
		{
			step++;
		}
		if (step == COUNT_NUM)
		{
			printf("%d out \n", people[pos]);
			people[pos] = invalid;
			step = 0;
			left--;
		}
	}

	return 0;
}